package org.example.dao;

import org.apache.ibatis.annotations.Delete;
import org.apache.ibatis.annotations.Insert;
import org.apache.ibatis.annotations.Select;
import org.apache.ibatis.annotations.Update;
import org.example.pojo.IdCard;

public interface IdCardDAO {
    @Select("select * from tb_idcard where id = #{id}")
    IdCard findById(Integer id);
    @Select("select * from tb_idcard")
    IdCard[] findAll();
    @Insert("insert into tb_idcard(cardNo, governmentSector, usefulYears) values(#{cardNo}, #{governmentSector}, #{usefulYears})")
    boolean save(IdCard idCard);
    @Update("update tb_idcard set cardNo = #{cardNo}, governmentSector = #{governmentSector}, usefulYears = #{usefulYears} where id = #{id}")
    boolean update(IdCard idCard);
    @Delete("delete from tb_idcard where id = #{id}")
    boolean delete(Integer id);
}
